Hands-On Data Structures and Algorithms with JavaScript by Kashyap Mukkamala

Hands-On Data Structures and Algorithms with JavaScript by Kashyap Mukkamala

Author:Kashyap Mukkamala
Language: eng
Format: epub
Tags: COM060080 - COMPUTERS / Web / General, COM060130 - COMPUTERS / Web / Design, COM051260 - COMPUTERS / Programming Languages / JavaScript
Publisher: Packt
Published: 2018-01-29T07:03:14+00:00


Creating a web server

We can now add a route to access this graph and its corresponding shortestPath method. Let's first create the route under routes/references and add it as a middleware to the web server:

var express = require('express');

var app = express();

var bodyParser = require('body-parser');

// register endpoints

var references = require('./routes/references');

// middleware to parse the body of input requests

app.use(bodyParser.json());

// route middleware

app.use('/references', references);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.